var t = getApp();

Component({
    properties: {
        show: {
            value: !1,
            type: Boolean
        },
        displaySetPass: {
            value: !0,
            type: Boolean
        }
    },
    data: {
        passValueArr: [],
        restrict: "",
        nemberKeyboardShow: !0
    },
    lifetimes: {
        attached: function() {},
        ready: function() {}
    },
    observers: {
        show: function(t) {
            t && this.checkCode();
        }
    },
    methods: {
        gotoBalance: function() {
            this.triggerEvent("close"), wx.navigateTo({
                url: "/packageA/member/balance_password/balance_password"
            });
        },
        handkeyboardinput: function(t) {
            var a = t.detail, e = a.value, s = a.type;
            if (console.log(this.data.passValueArr), "number" == s) {
                if (this.data.passValueArr.length < 6 && this.data.passValueArr.push(e), this.data.passValueArr.length >= 6) return this.triggerEvent("complete", this.data.passValueArr.join("")), 
                void this.setData({
                    show: !1,
                    passValueArr: []
                });
            } else "deleteBtn" == s && this.data.passValueArr.pop();
            this.setData({
                passValueArr: this.data.passValueArr
            });
        },
        setNemberKeyboardShow: function() {
            this.setData({
                nemberKeyboardShow: !0
            });
        },
        closePayKeyboard: function() {
            this.setData({
                show: !1
            }), this.triggerEvent("close");
        },
        submit: function() {
            console.log(this.data.passValueArr), this.data.passValueArr.length <= 16 && this.data.passValueArr.length >= 8 ? (this.triggerEvent("complete", this.data.passValueArr), 
            this.setData({
                show: !1,
                passValueArr: ""
            })) : (t.tips("请输入正确密码"), this.triggerEvent("close"), this.setData({
                show: !1,
                passValueArr: ""
            }));
        },
        tapinp: function(t) {
            this.setData({
                passValueArr: t.detail
            });
        },
        checkCode: function() {
            var a = this;
            if (!this.data.restrict) {
                wx.showLoading({
                    title: "加载中"
                });
                var e = t.getNetAddresss("payment.password.multiple");
                t._getNetWork({
                    showToastIn: !1,
                    url: e,
                    success: function(t) {
                        var e, s = t.data;
                        (wx.hideLoading({
                            success: function(t) {}
                        }), 1 == s.result) ? (e = s.data ? "more" : "once", a.setData({
                            restrict: e
                        })) : a.setData({
                            restrict: "more"
                        });
                    },
                    fail: function(t) {
                        wx.hideLoading(), a.setData({
                            restrict: "more"
                        });
                    }
                });
            }
        }
    },
    ready: function() {}
});